package top.lixunda.commerce.common.core.controller.wrapper;

import lombok.Data;

import java.util.List;

/**
 * @author LiXunda
 * @version time:2019/10/13 21:07
 */
@SuppressWarnings("ALL")
@Data
public class DataConditionBlock {

    private String op;

    private List<ConditionSegment> segs;

    private List<DataConditionBlock> blocks;

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder(op);
        if (segs != null) {
            segs.forEach(item -> builder.append(item.toString()));
        }
        if (blocks != null) {
            blocks.forEach(item -> builder.append(item.toString()));
        }
        return builder.toString();
    }

}
